package com.wc.alorithm_luogu.P3173_巧克力;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/3/15 10:29
 * @description https://www.luogu.com.cn/problem/P3173
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static PriorityQueue<Integer> q1 = new PriorityQueue<>(Comparator.reverseOrder());
    static PriorityQueue<Integer> q2 = new PriorityQueue<>(Comparator.reverseOrder());
    static int n, m;

    public static void main(String[] args) {
        n = sc.nextInt();
        m = sc.nextInt();
        for (int i = 1; i < n; i++) q1.add(sc.nextInt());
        for (int i = 1; i < m; i++) q2.add(sc.nextInt());
        long res = 0;
        int s1 = 1;
        int s2 = 1;
        // 只需要沿着最大的剪，就好了
        while (!q1.isEmpty() && !q2.isEmpty()) {
            if (q1.peek() > q2.peek()) {
                res += (long)q1.poll() * s2;
                s1++;
            } else {
                res += (long)q2.poll() * s1;
                s2++;
            }
        }
        while (!q1.isEmpty()) {
            res += (long)q1.poll() * s2;
//            s1++;
        }
        while (!q2.isEmpty()){
            res += (long)q2.poll() * s1;
//            s2++;
        }
        out.println(res);
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
